package com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : 杨世博
 * @date: Created in 2:10 2023/6/3
 */
@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    List<Goods> selectGoods(@Param("goodsKey") String goodsKey, Integer pageNum, Integer size);

    Integer selectCountByName(@Param("goodsTitle") String goodsTitle, @Param("goodsDetail") String goodsDetail);

    List<Goods> selectAll();

    List<Goods> selectGoodsByStore(@Param("merchant_id") Integer merchantId, @Param("key")String key, @Param("pageNum") Integer pageNum, @Param("size") Integer size);

    Integer selectCountByStore(@Param("merchant_id") Integer merchantId, @Param("key")String key, @Param("pageNum") Integer pageNum, @Param("size") Integer size);

    void updateStatus(@Param("goods_id") Integer goodsId, @Param("goods_status") Boolean goodsStatus);

    List<Goods> selectAllByAdmin(@Param("pageNum") Integer pageNum, @Param("size") Integer size);

    Long selectCountByAdmin();

    List<Goods> selectGoodsByAdmin(String key, Integer pageNum, Integer size);

    long selectCountByAdminKey(String key);
}
